//公告管理//query
Jes.Notice ={
	init : function(){
		if(!Jes.getUserSess()) return;
		Jes.cBtn('../../oppor/html/desk.html');
		Jes("search").onclick=function(){Jes.Notice.query();}
		Jes("add").onclick=function(){Jes.Notice.open('op');}
		Jes("del").onclick=function(){Jes.Notice.del('del');}
		initTabs('tabView_1',Array('公告查询'),0,"100%",90,Array(false));
		this.query();
	}
	,query : function(){
		Jes.page("notice_query_sql@base",{pageSize:10});
	}
	,del : function(){
		var ids = Jes.val("id");
		if(ids == ""){alert("至少选择一项!");return;}
		if(!confirm("你确定删除商机吗？")) return;
		Jes.exec({ids:ids,sql:"notice_delete_hql@base"});
	}
	,open : function(type,id){
		var args= arguments;
		switch(type){
			case "op":
					//Jes.open("../../oppor/html/opporop.html"+(id?"?id="+id:""),300,300);
					//Jes.Dialog.open("商机编辑","../../oppor/html/opporop.html"+(id?"?id="+id:""),300,300);
					//top.Jes.Dialog.open("商机编辑","../../oppor/html/opporop.html"+(id?"?id="+id:""),500,500);
					_newTab(id?'公告编辑':'公告新增',"noticeop.html".J({id:id}));
				break;
		}
	}
}

//op
Jes.NoticeOp = {
	init : function(){
		if(!Jes.getUserSess()) return;
		var id = Jes.request("id");
		Jes("add").onclick=function(){Jes.NoticeOp.save();}//save
		Jes.cBtn('notice.html');
		Jes.fck("content","680","250","Basic");
		Jes.get("TJesNotice",{id:id,title:"公告编辑"});
	}
	,save : function(){
		Jes.save("TJesNotice");
	}
}